package at.codebase.db.dao;

import static at.codebase.db.OfyService.ofy;

import java.util.List;

import at.codebase.db.entities.EItemCollection;

/**
 * @author Daniel Marth <danielmarth@gmx.at>
 */
public class EItemCollectionDao {

	public static EItemCollection getCollectionById(final long id) {
		return ofy().load().type(EItemCollection.class).id(id).get();
	}

	public static void saveConversation(EItemCollection collection) {
		ofy().save().entity(collection).now();
	}

	public static List<EItemCollection> getCollectionsForUserId(
			final long userId) {
		return ofy().load().type(EItemCollection.class)
				.filter("owners", new Long(userId)).list();
	}

}
